package com.zzl.example.springboottest.shop;

/**
 * @ClassName PrintOrder
 * @Description PrintOrder
 * @Author Zengliang Zheng
 * @Date 2023/5/25 14:40
 * @Version 1.0
 */
public class PrintOrder extends Order{
    private Order order;

    public PrintOrder(Order order) {
        this.order = order;
    }

    public void printOrder() {
        FootDecorator foot = new FootDecorator(order);
        HeadDecorator head = new HeadDecorator(foot);
        head.printOrder();
        System.out.println("------------------------------------");
        FootDecorator foot2 = new FootDecorator(null);
        HeadDecorator head2 = new HeadDecorator(foot2);
        head2.printOrder();
    }

    public static void main(String[] args) {
        Order order = new Order();
        PrintOrder print = new PrintOrder(order);
        print.printOrder();
    }
}

    
